You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cold installs stayed within network/cache noise and still use the existing object validation path. Earlier rejected trials: v2 cache-check concurrency 16->8, 16->32, and Unix mtime-nanos metadata hashing; each regressed or failed to produce a stable win.
Tests
cargo test -p lpm-store reusable_link_entry_from_snapshots --locked
cargo test -p lpm-cli prevalidate_v2_reusable_objects --locked
cargo test -p lpm-workflows --test install install_json_timing_detail --locked
Update after reproducing the macOS failure and rerunning the warm-relink benchmark:
The CI failure is real: the original fast path can reuse a link entry before the v2 object validation/repair path runs. I reproduced it locally with cargo nextest run --locked -p lpm-workflows --test install -E 'test(install_v2_cache_hit_repairs_tampered_object_before_linking)' --no-fail-fast --status-level slow --final-status-level fail.
I tested a local safety-correct patch that validates the reusable object before returning a ready link. Correctness passes, but the measured optimization no longer wins.
Median warm-relink totals, 3 runs:
fixture
baseline
safety-correct ready-link reuse
small-33
160 ms
181 ms
large-112
237 ms
269 ms
The safe version removes link await (~62-65 ms -> 0 ms) but moves the same work into fetch prevalidation (small 74 -> 162 ms, large 100 -> 219 ms) and increases metadata-hash time (small 112 -> ~145 ms, large 308 -> ~389 ms). A quick concurrency-cap experiment also failed to recover the loss.
Conclusion: this PR should stay draft/not merge as-is. The next attackable target is not “ready-link reuse after validation”; it is reducing or better attributing the v2 reusable metadata-hash validation cost, or adding narrower link-entry timing so we can optimize the actual package-link validation work without bypassing tamper repair.
Corrected local comparison artifact: /var/folders/p2/32lgcl857ds0wkcnkg0qk51h0000gn/T/lpm-install-perf-safety-final-2026-06-19T20-12-07-535Z/corrected-comparison.json.
tolgaergin
changed the title
Optimize warm relink validation reuse
Draft: Explore warm relink validation reuse
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
link_v2_onefor packages that can be materialized from the validated link entry.Noneand use the existing object validation + link path.Measurements
Release binary:
cargo build --release --locked -p lpm-cli --bin lpm-rsFixture matrix: cold, warm no-op, warm relink; 3 repeats; isolated project and
LPM_HOME;LPM_TIMING_DETAIL=trace.Baseline artifacts:
/tmp/lpm-install-perf-2026-06-19T18-47-26-032Z-14453/results/tmp/lpm-install-perf-large-2026-06-19T18-48-19-694Z-16051/resultsAfter artifacts:
/var/folders/p2/32lgcl857ds0wkcnkg0qk51h0000gn/T/lpm-install-perf-final-2026-06-19T19-44-32-829Z-17347/results/tmp/lpm-install-perf-final-comparison.jsonCold installs stayed within network/cache noise and still use the existing object validation path. Earlier rejected trials: v2 cache-check concurrency 16->8, 16->32, and Unix mtime-nanos metadata hashing; each regressed or failed to produce a stable win.
Tests
cargo test -p lpm-store reusable_link_entry_from_snapshots --lockedcargo test -p lpm-cli prevalidate_v2_reusable_objects --lockedcargo test -p lpm-workflows --test install install_json_timing_detail --lockedcargo fmt --checkcargo build --workspace --lockedcargo clippy --workspace --all-targets --locked -- -D warningscargo nextest run --locked --workspace --exclude lpm-workflows --exclude lpm-cli --no-fail-fast --status-level slow --final-status-level failcargo test --locked -p lpm-cli --bin lpm-rs -- --test-threads=1cargo nextest run --locked -p lpm-cli -E 'not binary_id(/bin\\/lpm-rs/)' --no-fail-fast --status-level slow --final-status-level fail